
<script>
    let obj = {a:1,b:2}
    console.log(obj.a)
    console.log(obj['a'])
    let key = 'a'
    console.log(obj.key)
    console.log(obj['key'])
    console.log(obj[key]) 
</script>